package com.study.jedis;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

/**
 * 演示redis集群操作
 */
public class RedisClusterDemo {
    public static void main(String[] args) {
        //创建redis集群对象
        HostAndPort hostAndPort = new HostAndPort("82.157.183.197", 11079);
        JedisCluster jedisCluster = new JedisCluster(hostAndPort);
        //进行操作
        jedisCluster.set("b1","value1");
        String value = jedisCluster.get("b1");
        System.out.println("value: "+value);
        // 输出：value: value1
        jedisCluster.close();
    }
}
